<div id="content" style="background-color:#ffffff">
<div id="content-header">
  <div id="breadcrumb"> <a href="?m=admin&t=main" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 系统首页</a> <a href="?m=admin&t=main" title="Go to Home" class="tip-bottom">发票模块</a> <a href="#" class="current">商家管理</a> </div>
</div>
<div class="container-fluid" >
  
  <div class="row-fluid" >
  
<!-- <blockquote class="layui-elem-quote layui-quote-nm">
 <a href="?m=admin&o=ticket&t=bus_manage_add" class="layui-btn">xxx</a>
</blockquote> -->
<fieldset class="layui-elem-field layui-field-title">
  <legend>接口日志</legend>
</fieldset>
	  
    <table class="layui-table">
	 
	  <thead>
	    <tr>
	      <th>渠道名称</th>
	      <th>应用</th>
          <th>接口</th>
       
          <th>状态</th>
          <th>时间</th>
		  <th width="5%">操作</th>
	    </tr> 
	  </thead>
	  <tbody>
		<{foreach item=v from=$datas}>
			<tr>
			  <td><{$v.channel_name}></td>
			  <td><{$v.app_name}></td>
			  <td><{$v.type}></td>
              
              <td><{$v.error_code}></td>
			  <td><{$v.timestamp|date_format:'%Y-%m-%d %H:%M:%S'}></td>
			  <td>
            	<button onclick="show_detial(<{$v.id}>)" class="show_detial layui-btn layui-btn-small">查看详情</button>
              
              </td>
			</tr>
            <tr   style='display:none'>
                <td colspan="5" id="detial_<{$v.id}>" >
                <div align='center' style='margin-top:-10px' >
                 <table class="layui-table">
                  <thead>
                    <tr>
                      <th width="45%">名称<?php echo 13;?></th>
                      <th>内容</th>
                    
                    </tr> 
                  </thead>
                  <tbody>
                    <tr>
                      <td>渠道名称</td>
                      <td><{$v.channel_name}></td>
                    </tr>
                    <tr>
                      <td>应用</td>
                      <td><{$v.app_name}></td>
                    </tr>
                    <tr>
                      <td>接口</td>
                      <td><{$v.type}></td>
                    </tr>
                     <tr>
                      <td>签名</td>
                      <td><{$v.sign}></td>
                    </tr>
                     <tr>
                      <td>报文</td>
                      <td><textarea class="layui-textarea"><{$v.receive_data}></textarea></td>
                    </tr>
                     <tr>
                      <td>结果</td>
                      <td><textarea class="layui-textarea"><{$v.send_data}></textarea></td>
                    </tr>
                     <tr>
                      <td>状态</td>
                      <td><{$v.error_code}></td>
                    </tr>
                     <tr>
                      <td>时间</td>
                      <td><{$v.timestamp|date_format:'%Y-%m-%d %H:%M:%S'}></td>
                    </tr>
                    
                 </table>
                 </div>
                 </td>
            </tr>
            
		<{/foreach}>
	  </tbody>
	</table>
<div align='center'><{$page_menu}> </div>
     
</div>
<script>
layui.use(['layer'], function(){
 	var layer = layui.layer
 	$(".create-ticket").click(function(){
		var shop_id = $(this).attr('shop_id');
		layer.prompt({title: '请输入开票金额，并确认', formType: 0}, function(data, index){
			 $.ajax({
			   type: "POST",
			   url: "index.php?m=admin&o=ticket&t=ajaxCreateTicket",
			   data: "price="+data+"&shop_id="+shop_id,
			   success: function(msg){
				 if(msg==0){
					layer.close(index);
					layer.alert('创建失败！');	 
				 }else{
					layer.close(index);
					layer.open({
						title:'二维码',
						area: ['350px', '450px'],
						content:"<a target='_blank' href='http://weixin_online/app/index.php?i=3&c=entry&do=open_ticket&m=xf_ticket&number="+$.trim(msg)+"'>开票地址</a><br><img src='http://qr.liantu.com/api.php?text=http://weixin.xiangfubao.com.cn/app/index.php?i=3%26c=entry%26do=open_ticket%26m=xf_ticket%26number="+$.trim(msg)+"'>"	
				
					}) 
				 }
			   }
			});
		});
	
	})
  

	
	$(".del").click(function(){
		var url = $(this).attr('d_href');
		layer.confirm('您确定要删除？', {
		  btn: ['确定','取消'] //按钮
		}, function(){
			 location.href=url;
		}, function(){
			layer.closeAll()
		});	
	
	})
	
	

});
function show_detial(id){
    
    layer.open({
        type: 1,
        shade: [0.8, '#080808'],
        title: false, //不显示标题
       
        content:$("#detial_"+id).html()
    
    })

}

</script>